#!/usr/bin/python
# This script splits multi-fasta file into individual fasta files
# Usage: dissertation_SplitMultiFasta.py multi.fasta

import sys
from Bio import SeqIO


seqdict = SeqIO.index(sys.argv[1], "fasta")

for seq in seqdict:
    #print seqdict[seq].format("fasta").strip("\n")
    outhandle = seqdict[seq].id + ".fasta"
    SeqIO.write(seqdict[seq], outhandle, "fasta")

